Skip to content

Commit

Permalink
use inlinescript
Browse files Browse the repository at this point in the history
Signed-off-by: Jianguo Ma <jiangma@microsoft.com>
  • Loading branch information
majguo committed Jul 16, 2024
1 parent 188b2fd commit 42ef46a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
2 changes: 0 additions & 2 deletions src/main/bicep/mainTemplate.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,6 @@ module preflightDsDeployment 'modules/_deployment-scripts/_ds-preflight.bicep' =
params: {
name: name_prefilghtDsName
location: location
_artifactsLocation: _artifactsLocation
_artifactsLocationSasToken: _artifactsLocationSasToken
identity: obj_uamiForDeploymentScript
createCluster: createCluster
aksClusterName: name_clusterName
Expand Down
12 changes: 3 additions & 9 deletions src/main/bicep/modules/_deployment-scripts/_ds-preflight.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
limitations under the License.
*/

param _artifactsLocation string = deployment().properties.templateLink.uri
@secure()
param _artifactsLocationSasToken string = ''
param location string
param name string = ''
param identity object = {}
Expand All @@ -41,7 +38,8 @@ param sourceImagePath string

param utcValue string = utcNow()

var const_scriptLocation = uri(_artifactsLocation, 'scripts/')
var base64_utility = loadFileAsBase64('../../../scripts/utility.sh')
var base64_preflight = loadFileAsBase64('../../../scripts/preflight.sh')

resource deploymentScript 'Microsoft.Resources/deploymentScripts@${azure.apiVersionForDeploymentScript}' = {
name: name
Expand Down Expand Up @@ -116,11 +114,7 @@ resource deploymentScript 'Microsoft.Resources/deploymentScripts@${azure.apiVers
value: sourceImagePath
}
]
primaryScriptUri: uri(const_scriptLocation, 'preflight.sh${_artifactsLocationSasToken}')
supportingScriptUris: [
uri(const_scriptLocation, 'utility.sh${_artifactsLocationSasToken}')
]

scriptContent: format('{0}\r\n\r\n{1}', base64ToString(base64_utility), base64ToString(base64_preflight))
cleanupPreference: 'OnSuccess'
retentionInterval: 'P1D'
forceUpdateTag: utcValue
Expand Down
5 changes: 0 additions & 5 deletions src/main/scripts/preflight.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,6 @@ function validate_gateway_frontend_certificates() {
validate_status_with_hint "access application gateway frontend key." "Make sure the Application Gateway frontend certificate is correct."
}

# Initialize
script="${BASH_SOURCE[0]}"
scriptDir="$(cd "$(dirname "${script}")" && pwd)"
source ${scriptDir}/utility.sh

# Main script
# Get the type of managed identity
uamiType=$(az identity show --ids ${AZ_SCRIPTS_USER_ASSIGNED_IDENTITY} --query "type" -o tsv)
Expand Down

0 comments on commit 42ef46a

Please sign in to comment.