Update azure-java-appservice-sql to Output-versioned invokes
MODIFY
azure-java-appservice-sql/README.md
azure-java-appservice-sql/README.md
@@ -22,7 +22,7 @@ Provisions Azure SQL Database and Azure Application Insights to be used in combi
```
$ pulumi config set azure-native:location westus
- $ pulumi config set azure-java-appservice-sql:sqlPassword <value>
+ $ pulumi config set azure-java-appservice-sql:sqlPassword <value> --secret
```
1. Run `pulumi up` to preview and deploy changes:

MODIFY
azure-java-appservice-sql/src/main/java/appservice/App.java
azure-java-appservice-sql/src/main/java/appservice/App.java
@@ -134,24 +134,27 @@ public class App {
ctx.export("endpoint", Output.format("https://%s", app.defaultHostName()));
}
- private static Output<String> getSASToken(Output<String> storageAccountName, Output<String> storageContainerName,
- Output<String> blobName, Output<String> resourceGroupName) {
- var blobSAS = Output.tuple(resourceGroupName, storageAccountName, storageContainerName).apply(t -> Output.of(
- StorageFunctions.listStorageAccountServiceSAS(
- ListStorageAccountServiceSASArgs.builder().resourceGroupName(t.t1)
- .accountName(t.t2)
+ private static Output<String> getSASToken(Output<String> storageAccount,
+ Output<String> storageContainer,
+ Output<String> blob,
+ Output<String> resourceGroup) {
+ var blobSAS = StorageFunctions.listStorageAccountServiceSAS(ListStorageAccountServiceSASArgs.builder()
+ .resourceGroupName(resourceGroup)
+ .accountName(storageAccount)
.protocols(HttpProtocol.Https)
.sharedAccessStartTime("2022-01-01")
.sharedAccessExpiryTime("2030-01-01")
.resource(SignedResource.C)
.permissions(Permissions.R)
- .canonicalizedResource(String.format("/blob/%s/%s", t.t2, t.t3))
+ .canonicalizedResource(String.format("/blob/%s/%s", storageAccount, storageContainer))
.contentType("application/json")
.cacheControl("max-age=5")
.contentDisposition("inline")
.contentEncoding("deflate")
- .build())));
+ .build()
+ );
var token = blobSAS.applyValue(ListStorageAccountServiceSASResult::serviceSasToken);
- return Output.format("https://%s.blob.core.windows.net/%s/%s?%s", storageAccountName, storageContainerName, blobName, token);
+ return Output.format("https://%s.blob.core.windows.net/%s/%s?%s",
+ storageAccount, storageContainer, blob, token);
}
}

Update azure-java-appservice-sql to Output-versioned invokes (#1263)