Skip to content

Commit

Permalink
fixed cloud connector script
Browse files Browse the repository at this point in the history
  • Loading branch information
christian bellee authored and christian bellee committed Jan 5, 2025
1 parent 887122a commit 3fb67f8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,6 @@ jobs:
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: cloudflareDomain
id: cloudflareDomain
uses: azure/PowerShell@v2
continue-on-error: false
with:
azPSVersion: "latest"
inlineScript: ./scripts/cloudflare-dns.ps1 -cloudFlareApiToken ${cloudFlareApiToken} -cloudFlareZoneId ${cloudFlareZoneId} -storageAccountWebEndpoint ${storage.outputs.webEndpoint} -cName ${cNameRecord}

- name: deploy-infra-cli
id: deploy-infra-cli
uses: azure/cli@v2
Expand Down
26 changes: 23 additions & 3 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,27 @@ resource enableCloudConnector 'Microsoft.Resources/deploymentScripts@2020-10-01'
]
}

module storageCustomDomain './modules/stor.bicep' = {
resource setStorageCustomDomain 'Microsoft.Resources/deploymentScripts@2020-10-01' = {
name: 'setStorageCustomDomain'
location: resourceGroup().location
kind: 'AzurePowerShell'
properties: {
forceUpdateTag: utcValue
azPowerShellVersion: '7.0'
timeout: 'PT5M'
retentionInterval: 'PT1H'
storageAccountSettings: {
storageAccountName: storageAccountName
storageAccountKey: storage.outputs.key
}
scriptContent: '$storageAccount = Get-AzStorageAccount -ResourceGroupName resourceGroup().name -Name storageAccountName ; $storageAccount.CustomDomain = New-Object Microsoft.Azure.Management.Storage.Models.CustomDomain ; $storageAccount.CustomDomain.Name = "${cNameRecord}.${zoneName}" ; $storageAccount.CustomDomain.UseSubDomainName = $false ; Set-AzStorageAccount -CustomDomain $storageAccount.CustomDomain -ResourceGroupName ${resourceGroup().name} -Name ${storageAccountName}'
}
dependsOn: [
//enableCustomDomainNotProxied
]
}

/* module storageCustomDomain './modules/stor.bicep' = {
name: 'StorageCustomDomainDeployment'
params: {
kind: 'StorageV2'
Expand All @@ -565,7 +585,7 @@ module storageCustomDomain './modules/stor.bicep' = {
//enableCustomDomainNotProxied
enableCloudConnector
]
}
} */

resource enableCustomDomainProxied 'Microsoft.Resources/deploymentScripts@2020-10-01' = {
name: 'enableCustomDomainProxied'
Expand All @@ -584,7 +604,7 @@ resource enableCustomDomainProxied 'Microsoft.Resources/deploymentScripts@2020-1
arguments: '-cloudFlareApiToken ${cloudFlareApiToken} -storageAccountWebEndpoint ${storage.outputs.webEndpoint} -cloudFlareZoneId ${cloudFlareZoneId} -cName ${cNameRecord} -ZoneName ${zoneName} -ProxyDns'
}
dependsOn: [
storageCustomDomain
setStorageCustomDomain
]
}

Expand Down

0 comments on commit 3fb67f8

Please sign in to comment.