Closed DPD-30 closed 6 months ago
Hi @DPD-30, Thank you very much for posting this and how you worked around it for others who might run into the same limitation. It's true that the current release is only supported for public cloud, but we can incorporate the ability to target any cloud in the next release - I've tagged this as an enhancement and will leave this open until that time so that others can see your notes.
@DPD-30 Just an update that the latest version of the PS scripts (1.0.2) allows for pointing to AzureUSGovernment cloud by changing only the configuration settings.json file (notes: https://github.com/Azure/App-Service-Migration-Assistant/wiki/Release-Notes). Thank you for raising this as an issue!
The currently published "App Service migration assistant for PowerShell scripts" https://github.com/Azure/App-Service-Migration-Assistant/wiki/PowerShell-Scripts do not support working with Azure Government. They work fine against Azure commercial but have not method to switch to or detect if you are using Azure government. I was able to modify the scripts to make this work.
Issue 1 no option to provide environment for for connect-azacount Issue 2 hard coded url for management api. "https://management.azure.com"
Investigative information
Please provide the following:
Repro steps
Provide the steps required to reproduce the problem:
Simple test
Test 2 Existing AZ login
Expected behavior
Expected behavior is for the code to either detect the environment or allow the user to select the environment.
Actual behavior
All azure commands are run against the Azure commercial environment in Simple Test steps above. For test 2 existing AZ login the validation of web site urls fail as it is run against the "https://management.azure.com" address. Which is hard coded in line 242 of MigrationHelperFunctions.psm1
Known workarounds
modify code in MigrationHelperFunctions.psm1
Replace line 242 $Uri = "https://management.azure.com/subscriptions/$AzureSubscriptionId/providers/microsoft.web/checknameavailability?api-version=2019-08-01" ---- With --- $context = get-azcontext
$Uri = "$($context.Environment.ResourceManagerUrl)/subscriptions/$AzureSubscriptionId/providers/microsoft.web/checknameavailability?api-version=2019-08-01"
Remove code signing signature at bottom of the file.
Save file
Run below to reload the module Import-Module .\MigrationHelperFunctions.psm1 -force
Run connect-azaccount -Environment AzureUSGovernment
Run any of the App Service migration assistant Powershell scripts they should function as expected with any azure environment now.