Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,22 @@ function Test-LinkedStorageAccountCRUD

Remove-AzApplicationInsightsLinkedStorageAccount -ResourceGroupName $rgname -ComponentName $appName

# Test CRUD by pipeline.
New-AzApplicationInsightsLinkedStorageAccount -InputObject $app -LinkedStorageAccountResourceId $account1.Id
$linkedAccount = Get-AzApplicationInsightsLinkedStorageAccount -InputObject $app

Assert-NotNull $linkedAccount
Assert-AreEqual $account1.Id $linkedAccount.linkedStorageAccount
Assert-AreEqual "serviceprofiler" $linkedAccount.Name

Update-AzApplicationInsightsLinkedStorageAccount -InputObject $app -LinkedStorageAccountResourceId $account2.Id
$linkedAccount = Get-AzApplicationInsightsLinkedStorageAccount -InputObject $app

Assert-NotNull $linkedAccount
Assert-AreEqual $account2.Id $linkedAccount.linkedStorageAccount

Remove-AzApplicationInsightsLinkedStorageAccount -InputObject $app

Remove-AzStorageAccount -ResourceGroupName $rgname -Name $accountName1 -force
Remove-AzStorageAccount -ResourceGroupName $rgname -Name $accountName2 -force

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public override void ExecuteCmdlet()
this.ResourceId = this.InputObject.Id;
}

if (this.IsParameterBound(c => c.ResourceId))
if (this.IsParameterBound(c => c.ResourceId) || !string.IsNullOrEmpty(this.ResourceId))
{
ResourceIdentifier identifier = new ResourceIdentifier(this.ResourceId);
this.ResourceGroupName = identifier.ResourceGroupName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public override void ExecuteCmdlet()
this.ResourceId = this.InputObject.Id;
}

if (this.IsParameterBound(c => c.ResourceId))
if (this.IsParameterBound(c => c.ResourceId) || !string.IsNullOrEmpty(this.ResourceId))
{
ResourceIdentifier identifier = new ResourceIdentifier(this.ResourceId);
this.ResourceGroupName = identifier.ResourceGroupName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public override void ExecuteCmdlet()
this.ResourceId = this.InputObject.Id;
}

if (this.IsParameterBound(c => c.ResourceId))
if (this.IsParameterBound(c => c.ResourceId) || !string.IsNullOrEmpty(this.ResourceId))
{
ResourceIdentifier identifier = new ResourceIdentifier(this.ResourceId);
this.ResourceGroupName = identifier.ResourceGroupName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public override void ExecuteCmdlet()
this.ResourceId = this.InputObject.Id;
}

if (this.IsParameterBound(c => c.ResourceId))
if (this.IsParameterBound(c => c.ResourceId) || !string.IsNullOrEmpty(this.ResourceId))
{
ResourceIdentifier identifier = new ResourceIdentifier(this.ResourceId);
this.ResourceGroupName = identifier.ResourceGroupName;
Expand Down
5 changes: 5 additions & 0 deletions src/ApplicationInsights/ApplicationInsights/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
- Additional information about change #1
-->
## Upcoming Release
* Fixed issue that `ResourcegroupName` is missed when executing below cmdlets with `InputObject` parameter [#14848]
* `Get-AzApplicationInsightsLinkedStorageAccount`
* `New-AzApplicationInsightsLinkedStorageAccount`
* `Update-AzApplicationInsightsLinkedStorageAccount`
* `Remove-AzApplicationInsightsLinkedStorageAccount`

## Version 1.1.0
* Added Parameters: `RetentionInDays` `PublicNetworkAccessForIngestion` `PublicNetworkAccessForQuery` for `New-AzApplicationInsights`
Expand Down