faint-tiger-16075
11/22/2021, 5:48 PMfancy-gpu-82886
12/27/2021, 9:49 AMdef create_publish_profile(publish_profile: ListWebAppPublishingCredentialsResult, app_url: str) -> str:
publish_url = publish_profile.scm_uri.split("@")[-1] + ":443"
user_name = publish_profile.publishing_user_name
user_pwd = publish_profile.publishing_password
destination_app_url = "https://" + app_url
publish_profile_string = f"""<publishData>
<publishProfile
publishUrl="{publish_url}"
userName="{user_name}"
userPWD="{user_pwd}"
destinationAppUrl="{destination_app_url}"
>
</publishProfile>
</publishData>"""
return publish_profile_string
app_publish_credentials = web.list_web_app_publishing_credentials_output(
name=app.name,
resource_group_name=resource_group.name
)
gh.ActionsSecret("github-publish-profile",
secret_name="AZURE_WEBAPP_PUBLISH_PROFILE",
repository=config.get("repo-name"),
plaintext_value=pulumi.Output.all(
app_publish_credentials,
app.default_host_name,
).apply(lambda args: create_publish_profile(*args))
)