Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Updating deploy.py for dotnet deployments #1752 #1830

Merged
Changes from 4 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
73f58b9
updating deploy.py for dotnet packages
AdamL-Microsoft Apr 19, 2022
12f1e22
Merge branch 'microsoft:main' into updating-deploy.py-for-dotnet-depl…
AdamL-Microsoft Apr 22, 2022
1e311fb
dotnet deployment needs to be along side python if flagged
AdamL-Microsoft Apr 22, 2022
e746b27
indivdual deployment state for dotnet api since this will deploy alon…
AdamL-Microsoft Apr 22, 2022
e3c41c8
correcting state order for dotnet-api deployment step to follow pytho…
AdamL-Microsoft Apr 22, 2022
31ba07e
Merge branch 'microsoft:main' into updating-deploy.py-for-dotnet-depl…
AdamL-Microsoft Apr 22, 2022
7c6a67f
Merge branch 'microsoft:main' into updating-deploy.py-for-dotnet-depl…
AdamL-Microsoft Apr 24, 2022
1c0f693
cleanup deploy.py formatting
AdamL-Microsoft Apr 24, 2022
dffa14b
Merge branch 'microsoft:main' into updating-deploy.py-for-dotnet-depl…
AdamL-Microsoft Apr 26, 2022
d413f65
Adding dotnet's zip package arguments to deploy and fixing func comma…
AdamL-Microsoft Apr 28, 2022
3ca4d89
changed quotes to pass black check
AdamL-Microsoft Apr 28, 2022
c606aeb
Merge branch 'microsoft:main' into updating-deploy.py-for-dotnet-depl…
AdamL-Microsoft Apr 28, 2022
a471cf3
Merge branch 'microsoft:main' into updating-deploy.py-for-dotnet-depl…
AdamL-Microsoft Apr 28, 2022
74ed835
Merge branch 'microsoft:main' into updating-deploy.py-for-dotnet-depl…
AdamL-Microsoft Apr 29, 2022
3605228
reconfiguring bicep templates to deploy function app settings correct…
AdamL-Microsoft Apr 29, 2022
6db9fb7
Merge branch 'microsoft:main' into updating-deploy.py-for-dotnet-depl…
AdamL-Microsoft May 2, 2022
e497e1f
Merge branch 'microsoft:main' into updating-deploy.py-for-dotnet-depl…
AdamL-Microsoft May 2, 2022
7422d0f
Merge branch 'microsoft:main' into updating-deploy.py-for-dotnet-depl…
AdamL-Microsoft May 2, 2022
0b1711f
Merge branch 'microsoft:main' into updating-deploy.py-for-dotnet-depl…
AdamL-Microsoft May 2, 2022
60d9f84
Merge branch 'main' into updating-deploy.py-for-dotnet-deployments
AdamL-Microsoft May 3, 2022
8a82e6a
Merge branch 'main' into updating-deploy.py-for-dotnet-deployments
AdamL-Microsoft May 3, 2022
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
52 changes: 51 additions & 1 deletion src/deployment/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,44 @@ def deploy_app(self) -> None:
if error is not None:
raise error

def deploy_dotnet_app(self) -> None:
logger.info("deploying function app %s", self.app_zip)
with tempfile.TemporaryDirectory() as tmpdirname:
with zipfile.ZipFile(self.app_zip, "r") as zip_ref:
func = shutil.which("func")
assert func is not None

zip_ref.extractall(tmpdirname)
error: Optional[subprocess.CalledProcessError] = None
max_tries = 5
for i in range(max_tries):
try:
subprocess.check_output(
[
func,
"azure",
"functionapp",
"publish",
self.application_name,
"--dotnet",
"--no-build",
],
env=dict(os.environ, CLI_DEBUG="1"),
cwd=tmpdirname,
)
return
except subprocess.CalledProcessError as err:
error = err
if i + 1 < max_tries:
logger.debug("func failure error: %s", err)
logger.warning(
"function failed to deploy, waiting 60 "
"seconds and trying again"
)
time.sleep(60)
if error is not None:
raise error

def update_registration(self) -> None:
if not self.create_registration:
return
Expand Down Expand Up @@ -1192,6 +1230,11 @@ def main() -> None:
nargs="*",
help="Set additional AAD tenants beyond the tenant the app is deployed in",
)
parser.add_argument(
"--dotnet_deploy",
action="store_true",
help="deploys the dotnet version of the app along with the python version",
)

args = parser.parse_args()

Expand Down Expand Up @@ -1238,7 +1281,14 @@ def main() -> None:
)
states = rbac_only_states
else:
states = full_deployment_states
if args.dotnet_deploy:
logger.info(
"deploying dotnet and python services for Azure functions"
)
AdamL-Microsoft marked this conversation as resolved.
Show resolved Hide resolved
states = full_deployment_states + [("dotnet-api", Client.deploy_dotnet_app)]
AdamL-Microsoft marked this conversation as resolved.
Show resolved Hide resolved
else:
states = full_deployment_states


if args.start_at != states[0][0]:
logger.warning(
Expand Down