Skip to content

Commit

Permalink
[AzurePowerShell@2,3,4,5] [AzureFileCopy@2,3,4] [SqlAzureDacpacDeploy…
Browse files Browse the repository at this point in the history
…ment@1] Update Initialize-AzSubscription to use endpoint Environment in Connect-AzAccount to work with MSIs in AzureUSGov, ChinaCloud, etc. (#14533)

* Update InitializeAz.ps1

* Update InitializeAz.ps1

* derive subscription/tenant from existing context

* do not assume subscriptionId from connect-Az

* issue is in MSI branch for InitializeAzModuleFunctions

* fix: Connect-AzAccount assumes subscription

* fix: use conventional environmentName

* reverse formatter

* reset whitespace

* restore environment name

* whitespace

* Update InitializeAzModuleFunctions.ps1

* Update InitializeAzModuleFunctions.ps1

* chore: update patch numbers

* chore: bump sprint numbers

Co-authored-by: Nina Reynolds <[email protected]>
Co-authored-by: Amruta Kawade <[email protected]>
  • Loading branch information
3 people authored Apr 7, 2021
1 parent bd34ad0 commit 8c190dc
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Tasks/AzureCloudPowerShellDeploymentV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 175,
"Patch": 3
"Minor": 184,
"Patch": 0
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 2,
"Minor": 184,
"Patch": 0
"Patch": 1
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV3/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 3,
"Minor": 184,
"Patch": 0
"Patch": 1
},
"demands": [
"azureps"
Expand Down
4 changes: 2 additions & 2 deletions Tasks/AzureFileCopyV4/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 4,
"Minor": 184,
"Patch": 1
"Minor": 185,
"Patch": 0
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzurePowerShellV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 2,
"Minor": 184,
"Minor": 185,
"Patch": 0
},
"demands": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzurePowerShellV3/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 3,
"Minor": 184,
"Minor": 185,
"Patch": 0
},
"releaseNotes": "Added support for Fail on standard error and ErrorActionPreference",
Expand Down
4 changes: 2 additions & 2 deletions Tasks/AzurePowerShellV4/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 4,
"Minor": 184,
"Patch": 1
"Minor": 185,
"Patch": 0
},
"releaseNotes": "Added support for Az Module and cross platform agents.",
"groups": [
Expand Down
4 changes: 2 additions & 2 deletions Tasks/AzurePowerShellV5/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 5,
"Minor": 184,
"Patch": 1
"Minor": 185,
"Patch": 0
},
"releaseNotes": "Added support for Az Module and cross platform agents.",
"groups": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Dot source Utility functions.
# Dot source Utility functions.
. $PSScriptRoot/Utility.ps1

function Initialize-AzModule {
Expand Down Expand Up @@ -135,8 +135,8 @@ function Initialize-AzSubscription {

} elseif ($Endpoint.Auth.Scheme -eq 'ManagedServiceIdentity') {
try {
Write-Host "##[command]Connect-AzAccount -Identity @processScope"
$null = Connect-AzAccount -Identity @processScope
Write-Host "##[command]Connect-AzAccount -Environment $environmentName -Identity @processScope"
$null = Connect-AzAccount -Environment $environmentName -Identity @processScope
} catch {
# Provide an additional, custom, credentials-related error message.
Write-VstsTaskError -Message $_.Exception.Message
Expand Down Expand Up @@ -191,4 +191,4 @@ function Set-CurrentAzSubscription {

Write-Host "##[command] Set-AzContext -SubscriptionId $SubscriptionId $(Format-Splat $additional)"
$null = Set-AzContext -SubscriptionId $SubscriptionId @additional
}
}
4 changes: 2 additions & 2 deletions Tasks/SqlAzureDacpacDeploymentV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 178,
"Patch": 2
"Minor": 184,
"Patch": 0
},
"demands": [
"sqlpackage"
Expand Down

0 comments on commit 8c190dc

Please sign in to comment.